package com.exam.service.impl;

import com.exam.mapper.AdminMapper;
import com.exam.mapper.StudentMapper;
import com.exam.mapper.TeacherMapper;
import com.exam.po.Admin;
import com.exam.po.Student;
import com.exam.po.Teacher;
import com.exam.service.LoginService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author mahaoqi
 * @ClassName LoginServiceImpl
 * @Description TODO
 * @Date 2021/1/12 17:29
 * @Version 1.0
 **/
@Service
public class LoginServiceImpl implements LoginService {

    @Resource
    private AdminMapper adminMapper;
    @Resource
    private TeacherMapper teacherMapper;
    @Resource
    private StudentMapper studentMapper;

/*
 * @Author mahaoqi
 * @Description 登录得三种方式
 * @Date 2021/1/13 10:56
 * @Param [adminid, pwd]
 * @return com.exam.po.Admin
 **/
    @Override
    public Admin findAdminByIdAndPassword(Integer adminid, String pwd) {
        return adminMapper.findByIdAndPwd(adminid,pwd);
    }
    @Override
    public Teacher findTeacherByIdAndPassword(Integer teacherid, String pwd) {
        return teacherMapper.findByIdAndPwd(teacherid,pwd);
    }
    @Override
    public Student findStudentByIdAndPassword(Integer studentid, String pwd) {
        return studentMapper.findByIdAndPwd(studentid,pwd);
    }
}
